package es.udc.emarketapp.emarket.model.category.dao;

import java.sql.Connection;
import java.util.List;

import es.udc.emarketapp.emarket.model.category.vo.CategoryVO;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;

public interface SQLCategoryDAO {

   public CategoryVO create(Connection connection, CategoryVO categoria)
        throws InternalErrorException;

   public boolean exists(Connection connection, Long idCat)
    	throws InternalErrorException;

   public CategoryVO findById(Connection connection, Long idCat)
	throws InternalErrorException, InstanceNotFoundException;

   public CategoryVO findByName(Connection connection, String name)
	throws InstanceNotFoundException, InternalErrorException;

   public List<CategoryVO> getSons(Connection connection, Long catPadre,
	int startIndex, int count) throws InternalErrorException;

   public void update(Connection connection, CategoryVO category)
	throws InstanceNotFoundException, InternalErrorException;

   public void remove(Connection connection, Long idCategoria)
	throws InstanceNotFoundException, InternalErrorException;

}
